package data;

import java.awt.image.BufferedImage;
import java.util.Iterator;
import java.util.List;

public class Personne {
	private String nom;
	private String prenom;
	private List<Numero> lesNum;
	private Adresse adress;
	private List<String> emails;
	private BufferedImage photo;

	public Personne(String nom, String prenom, List<Numero> lesNum,
			Adresse adress, List<String> emails) {
		this.nom = nom;
		this.prenom = prenom;
		this.lesNum = lesNum;
		this.adress = adress;
		this.emails = emails;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public String getPrenom() {
		return prenom;
	}

	public void setPrenom(String prenom) {
		this.prenom = prenom;
	}

	public List<Numero> getLesNum() {
		return lesNum;
	}

	public void addNum(Numero num) {
		lesNum.add(num);
	}

	public void removeNum(int id) {

		Iterator<Numero> n = lesNum.iterator();
		boolean continu = true;
		while (n.hasNext() && continu) {
			if (n.next().getId() == id) {
				n.remove();
				continu = false;
			}
		}
	}

	public Adresse getAdress() {
		return adress;
	}

	public void setAdress(Adresse adress) {
		this.adress = adress;
	}

	public List<String> getEmails() {
		return emails;
	}

	public void addEmail(String em) {
		emails.add(em);
	}

	public void removeEmail(String em) {
		emails.remove(em);
	}
}
